// // import 'package:flutter/material.dart';
// // import 'package:get/get.dart';
// //
// // import 'multi_window_controller.dart';
// //
// // class MultiWindowPage extends StatelessWidget {
// //
// //   @override
// //   Widget build(BuildContext context) {
// //     return GetBuilder<
// //         MultiWindowController>(
// //         init: MultiWindowController(),
// //         builder: (controller) {
// //           return Scaffold( appBar: AppBar(title: Text('多窗口')));});}}
//
// import 'package:flutter/material.dart';
//
// void main() {
//   RegularWindowController controller = RegularWindowController(
//       size: const Size(640, 480));
//   runApp(RegularWindow(controller: controller, child: MyApp()))
//   );
// }
//
// class MyApp extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//         home: const Home(),
//         useWindowingApi: true  // When true, material widgets will use the windoiwng API where appropriate
//     );
//   }
// }
//
// class Home extends StatefulWidget {
//   @override
//   State<Home> createState() => HomeState();
// }
//
// class _HomeState extends State<Home> {
//   RegularWindowController? controller;
//
//   @override
//   Widget build(BuildContext context) {
//     return Scaffold(
//         body: Column(children:<Widget>[
//         ViewAnchor(
//         view: controller ? RegularWindow(,
//             controller: controller,
//             child: MaterialApp(home: const Home())
//         ) : null,
//         child: OutlinedButton(
//             onPressed: _onToggleSattelite,
//             child: const Text("Toggle Child Window")),
//         OutlinedButton(onPressed: _onGrowWindow,
//             child: const Text("Grow Window"))
//         ]);
//     );
//   }
//
//   void _onToggleSattelite() {
//     if (controller != null) {
//       controller!.destroy();
//     }
//     else {
//       setState(() => controller = RegularWindowController(
//           size: const Size(400, 300),
//           /// This callback is triggered when the window is closed
//           /// for any reason. This may be the user clicking the "X"
//           /// on a window, or the app requesting that the window be closed.
//           onDestroyed: () => setState(() => controller = null),
//
//           /// If a window cannot be created for any reason (e.g. it is not
//           /// supported on the platform) this callback will be triggered.
//           /// The caller may do what they like with is error - in this
//           /// case no longer trying to show the window.
//           onError: (String reason) => setState(() => controller = null)
//       ));
//     }
//   }
//
//   void _onGrowWindow() {
//     if (!controller) {
//       return;
//     }
//
//     Size newSize = controller.size;
//     newSize.width += 20;
//     newSize.height += 20;
//     controller.modify(size: newSize);
//   }
// }
//
